<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    var jsonArr = [
        {"id": "1", "name": "A1"},
        {"id": "2", "name": "A2"},
        {"id": "3", "name": "A3"},
        {"id": "4", "name": "A4"},
        {"id": "5", "name": "A5"}
    ];
    console.log(jsonArr);
    var a = [] ;
    for(var i=0;i<jsonArr.length;i++){
        a.push(jsonArr[i]["id"]);
    }
    console.log(a); //[1,2,3,4,5]
    var b = a.join(',');
    console.log(b); //1,2,3,4,5
</script>
</body>
</html>